package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ProductStockInMapper;
import com.ruoyi.system.domain.ProductStockIn;
import com.ruoyi.system.service.IProductStockInService;

/**
 * 商品入库 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-30
 */
@Service
public class ProductStockInServiceImpl implements IProductStockInService
{
    @Autowired
    private ProductStockInMapper productStockInMapper;

    /**
     * 通过id查询商品入库
     *
     * @param id 商品入库主键
     * @return 商品入库
     */
    @Override
    public ProductStockIn selectProductStockInById(Long id)
    {
        return productStockInMapper.selectProductStockInById(id);
    }

    /**
     * 通过仓库名称查询商品入库列表
     *
     * @param warehouseName 仓库名称
     * @return 商品入库
     */
    @Override
    public List<ProductStockIn> selectProductStockInListByName(String warehouseName)
    {
        return productStockInMapper.selectProductStockInListByName(warehouseName);
    }

    /**
     * 新增商品入库
     *
     * @param productStockIn 商品入库
     * @return 结果
     */
    @Override
    public int insertProductStockIn(ProductStockIn productStockIn)
    {
        return productStockInMapper.insertProductStockIn(productStockIn);
    }

    /**
     * 修改商品入库
     *
     * @param productStockIn 商品入库
     * @return 结果
     */
    @Override
    public int updateProductStockIn(ProductStockIn productStockIn)
    {
        return productStockInMapper.updateProductStockIn(productStockIn);
    }

    /**
     * 通过id批量删除商品入库信息
     *
     * @param ids 需要删除的商品入库主键
     * @return 结果
     */
    @Override
    public int deleteProductStockInByIds(Long[] ids)
    {
        return productStockInMapper.deleteProductStockInByIds(ids);
    }

    /**
     * 通过id删除商品入库信息
     *
     * @param id 商品入库主键
     * @return 结果
     */
    @Override
    public int deleteProductStockInById(Long id)
    {
        return productStockInMapper.deleteProductStockInById(id);
    }
}
